
import { createReactive } from '../../libs/reactive.js';

// 视图
const template = `
  <ul class="list">
    <h1>{{ title }}</h1>
    {{ dateTime }}
    <for data="list" tag="li" class="item">
      <span>Name: { name }</span>
      <span>Age: { age }</span>
    </for>
  </ul>
`;

function TestB() {
  const state = createReactive({
    title: '教师信息表',
    dateTime: '2021-12-28 15:33',
    list: [
      {
        id: 1,
        name: '张三',
        age: 26
      },
      {
        id: 2,
        name: '李四',
        age: 29
      },
      {
        id: 3,
        name: '王五',
        age: 31
      }
    ]
  })

  return [ template, state ];
}

export default TestB;
